//Alarm function

#include "easybutterfly.h"
#include "macro.h"

void alarm(void){

	//This function will activate the alarm (sound and light)
	if(shalarm){
		LCD_TEXT("ALARM")
		shalarm = 0;
	}
	//this for loop is to create the sound, x = frequency
	for(int x=20;x<=5000;x+=20){
		if(x < 2500){
			alarm_light_ON;	//turning on a led
		}else{
			alarm_light_OFF;
		}
		BEEP(x,0.1)
	}

}

